package com.demo.controller;

import com.demo.bo.CityBO;
import com.demo.service.ITestService;
import com.demo.vo.TestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by Administrator on 2016/12/1.
 */
@Controller
@RequestMapping("/test")
public class TestController {
    @Autowired
    private ITestService iTestService;

    @RequestMapping("/getList")
    @ResponseBody
    public List<CityBO> getList(TestVO testVO) {
        List<CityBO> list = iTestService.selectCityList();
        return list;
    }
    @RequestMapping("/createTable")
    @ResponseBody
    public String createTable(TestVO testVO) {
        String name = testVO.getName();

        String result = iTestService.createTableByOrginalTable(name);
        return result;
    }
}
